package com.tencent.wxcloudrun.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhe.wang@weimob.com
 * @date 2022/4/18 上午10:14
 */
@Configuration
public class Swagger3Config {

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("default")
                .pathsToMatch("/**")
                .build();
    }

    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("wx cloud run API")
                        .description("腾讯开放平台测试API")
                        .version("v0.0.1"))
                .externalDocs(new ExternalDocumentation()
                        .description("Wiki Documentation")
                        .url(""));
    }

}
